#ifndef _HELLO_CLASS_H_
#define _HELLO_CLASS_H_

#include <iostream>
#include <string>
#include <boost/shared_ptr.hpp>
#include <vector>
#include <MyPointers.h>

class Hello
{
public:
   Hello()
   {
      mMessage = "No message";
      mName = "HelloClass";
      setNums(std::vector<int>(1,1));
   }

   Hello(std::string msg)
   {
      mMessage = msg;
      mName = "HelloClass";
      setNums(std::vector<int>(2,2));
   }

   std::string getMessage()
   { return mMessage; }
   void setMessage(std::string msg)
   { mMessage = msg; }

   std::string getName()
   { return mName; }
   void setName(std::string name)
   { mName = name; }

   void printWelcome()
   {
      std::cout << "Hello, I am " << mName << ". Message: " << mMessage << std::endl;
   }

   std::vector<int> getNums()
   { return nums; }
   void setNums(std::vector<int> n)
   { nums = n; }
   void printNums()
   {
      for (unsigned i=0;i<nums.size();++i)
         std::cout << i << ": " << nums[i] << std::endl;
   }

public:
   std::string mMessage;
   std::string mName;
   std::vector<int>  nums;
};

my_ptr<Hello> newSharedHello()
{ return my_ptr<Hello>(new Hello); }

Hello* newPtrHello()
{ return new Hello; }

Hello& helloRef()
{
  static Hello h;
  return h;
}

/** Class that says hello, but is not smart enough to know how */
class Greeter
{
public:
   Greeter()
   {;}

   void greet()
   {
      if(mMyHello.get())
         mMyHello->printWelcome();
      else
         std::cout << "<i am mute>" << std::endl;
   }

   void setHello(boost::shared_ptr<Hello> h)
   { mMyHello = h; }

   boost::shared_ptr<Hello> myHello()
   { return mMyHello; }

protected:
   boost::shared_ptr<Hello>   mMyHello;   /**< How I say hello */
};


#endif
